<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    const arr1 = ['red', 'blue', 'green']


    // 找小米 这个对象，并且返回这个对象
    const arr2 = [
      {
        name: '小米',
        price: 1999
      },
      {
        name: '华为',
        price: 3999
      },
      {
        name: 'IQOO',
        price: 5999
      },
    ]

    // 1. find 查找

    // const res = arr2.find(item => item.name === '华为')
    // console.log(res);

    const res2 = arr2.filter(item => item.price > 2000)
    console.log(res2);

    // 2. every 每一个是否都符合条件，如果都符合返回 true ，否则返回false
    const arr3 = [10, 20, 30]
    const res3 = arr3.every(item => item >= 20)
    console.log(res3);

    const res4 = arr3.some(item => item >= 20)
    console.log(res4);
  </script>
</body>

</html>